package com.bw.gmallpublisher.service.impl;

import com.bw.gmallpublisher.mapper.UvMapper;
import com.bw.gmallpublisher.service.UvService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigInteger;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class UvServiceImp  implements UvService {
    @Autowired
    UvMapper  mapper;
    @Override
    public Map selectUVByCH(int date) {
        HashMap<String, BigInteger> map = new HashMap<>();
        List<Map> list = mapper.selectUVByCH(date);
        System.out.println(list);
        for (Map map1 : list) {

            map.put((String) map1.get("ch"),(BigInteger)map1.get("uv"));
        }
        return map;
    }
}
